package com.seckill.controller.admin;

import com.seckill.pojo.entity.SeckillActivity;
import com.seckill.service.SeckillActivityService;

import com.sky.result.PageResult;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 秒杀活动管理接口
 */
@RestController
@RequestMapping("/admin/seckill/activity")
//@Api(tags = "秒杀活动管理接口")
@Slf4j
public class SeckillActivityController {

    @Autowired
    private SeckillActivityService seckillActivityService;

    /**
     * 新增秒杀活动
     *
     * @param seckillActivity
     * @return
     */
    @PostMapping
    //@ApiOperation("新增秒杀活动")
    public Result<String> save(@RequestBody SeckillActivity seckillActivity) {
        log.info("新增秒杀活动：{}", seckillActivity);
        seckillActivityService.save(seckillActivity);
        return Result.success();
    }

}